{#

Notice for plugins and theme developer:

This template can be extended over sw_extends.
The blocks from the templates in the /includes folder can be overwritten directly in this template

#}

{% sw_extends '@Framework/documents/base.html.twig' %}

{% block document_title_tag %}
    {% trans with {'%deliveryNoteNumber%': config.custom.deliveryNoteNumber, '%orderNumber%':  order.orderNumber} %}document.deliveryNoteHeadline{% endtrans %}
{% endblock %}

{% block document_headline %}
    <h1 class="headline" tabindex="0">
        {% trans with {'%deliveryNoteNumber%': config.custom.deliveryNoteNumber, '%orderNumber%': order.orderNumber} %}document.deliveryNoteHeadline{% endtrans %}
    </h1>
{% endblock %}

    {% set firstDelivery = order.deliveries|first %}
    {% set deliveryAddressId = firstDelivery.shippingOrderAddressId %}
    {% set deliveryAddress = order.addresses.get(deliveryAddressId) %}

{% block document_recipient %}
    {% if config.displayReturnAddress %}
        <span class="company-address-small">{{ addressParts|join(' - ') }}</span><br><br>
    {% endif %}

    {% sw_include '@Framework/snippets/render.html.twig' with {
        format: deliveryAddress.country.translated.addressFormat,
        address: deliveryAddress
    } %}<br/>
{% endblock %}

{% block document_side_info_contents %}
    {{ parent() }}
    <tr><td>{% trans with {'%deliveryDate%': config.custom.deliveryDate|format_date('medium', locale=order.language.locale.code)} %}document.deliveryDate{% endtrans %}</td></tr>
{% endblock %}

{% block document_line_item_table_shipping %}
    {% if deliveryAddress.additionalAddressLine1 %}<br>{% endif %}
    {% if deliveryAddress.additionalAddressLine2 %}<br>{% endif %}
{% endblock %}

{% block document_sum %}
{% endblock %}
